function weights = initWeights(layerSizes, maxWeight)

numLayers = length(layerSizes) - 1;
weights = cell(numLayers, 1);

for i = 1 : numLayers
    weights{i} = rand(layerSizes(i + 1), layerSizes(i) + 1) ...
            * 2 * maxWeight - maxWeight;
end
